﻿showRandomImg = true;
aBold = true;
numposts = 7;
summaryPost = 140;
summaryTitle = 25;
numposts1 = 6;
newlabel = "?";
label2 = "2";
label3 = "3";
label4 = "4";
label5 = "5";
label6 = "Nội dung liên quan";
imgr = new Array();
imgr[0] = "http://2.bp.blogspot.com/-CtAx8yTNNGo/UivXaJLI77I/AAAAAAAAAB8/Mz2WgIXiZaA/s1600/123.jpg";
showRandomImg = true;
labelnumposts = 40;
labelnumposts1 = 12;
showPostDate = true;
var thumbnail_mode = "no-float" ;
summary_noimg = 0; summary_img = 0; 
relatednumposts=8;
relatedtitle= "Sản Phẩm Liên Quan";
tabtitle1 = "Chi Tiết ";
tomtattitle = "Chi tiết sản phẩm";
urldathang = "/p/dat-hang.html";
addcart = "Mua Hàng";
urlnewimg = "https://lh4.googleusercontent.com/-yeElKMyYFFQ/T63-ntckhdI/AAAAAAAACpM/xaZwZCsNp34/s29/new.gif";
newimgwidth = 29;
newimgheight = 19;
sumtitle = 80;
labelsumtitle = 80;
newssumtitle=70;
function removeHtmlTag(_0x451dx2, _0x451dx3) {
    for (var _0x451dx4 = _0x451dx2['split']('<'), _0x451dx5 = 0; _0x451dx5 < _0x451dx4['length']; _0x451dx5++) {
        -1 != _0x451dx4[_0x451dx5]['indexOf']('>') && (_0x451dx4[_0x451dx5] = _0x451dx4[_0x451dx5]['substring'](_0x451dx4[_0x451dx5]['indexOf']('>') + 1, _0x451dx4[_0x451dx5]['length']));
    };
    _0x451dx4 = _0x451dx4['join']('');
    return _0x451dx4['substring'](0, _0x451dx3 - 1);
};

function homepage(_0x451dx2, _0x451dx3, _0x451dx4) {
    var _0x451dx2 = document['getElementById'](_0x451dx2),
        _0x451dx5 = '',
        _0x451dx7 = _0x451dx2['getElementsByTagName']('img');
    1 <= _0x451dx7['length'] && (_0x451dx5 = '<img class="item_image" src="' + _0x451dx7[0]['src'] + '"/>');
    price = _0x451dx2['innerHTML']['substring'](_0x451dx2['innerHTML']['indexOf']('[giaban]') + 8, _0x451dx2['innerHTML']['indexOf']('[/giaban]'));
    sumpost = _0x451dx2['innerHTML']['substring'](_0x451dx2['innerHTML']['indexOf']('[tintuc]') + 8, _0x451dx2['innerHTML']['indexOf']('[/tintuc]'));
    _0x451dx3 = -1 != _0x451dx2['innerHTML']['indexOf']('[tintuc]') ? '<div class="hello-h-left"><a href="'+_0x451dx4+'"><img src="'+_0x451dx7[0]['src']+'"/></a><h3><a href="'+_0x451dx4+'" title="'+removeHtmlTag(_0x451dx3, newssumtitle)+'">'+removeHtmlTag(_0x451dx3, newssumtitle)+'</a></h3><div class="hello-left-info">'+removeHtmlTag(sumpost, 200)+'...</div></div><div class="clear"></div>' : '<div class="homepage simpleCart_shelfItem"><a href="' + _0x451dx4 + '">' + _0x451dx5 + '</a><a href="' + _0x451dx4 + '"><h5 class="item_name">' + removeHtmlTag(_0x451dx3, sumtitle) + '</h5></a><div class="item_price1"><span class="item_price">' + price + '</span></div><div class="bottom"><a class="dt" href="' + _0x451dx4 + '">Chi ti\u1EBFt</a></div>';
    _0x451dx2['innerHTML'] = _0x451dx3;
};
function chitietsp(_0x451dx2, _0x451dx3, _0x451dx4) {
    var _0x451dx2 = document['getElementById'](_0x451dx2),
        _0x451dx5 = '',
        _0x451dx7 = _0x451dx2['getElementsByTagName']('img');
    1 <= _0x451dx7['length'] && (_0x451dx5 = '<img src="' + _0x451dx7[0]['src'] + '"/>');
    var _0x451dx9 = _0x451dx2['innerHTML']['substring'](_0x451dx2['innerHTML']['indexOf']('[tomtat]') + 8, _0x451dx2['innerHTML']['indexOf']('[/tomtat]')),
        _0x451dxa = _0x451dx2['innerHTML']['substring'](_0x451dx2['innerHTML']['indexOf']('[giaban]') + 8, _0x451dx2['innerHTML']['indexOf']('[/giaban]'));
    tintuc = _0x451dx2['innerHTML']['substring'](_0x451dx2['innerHTML']['indexOf']('[tintuc]') + 8, _0x451dx2['innerHTML']['indexOf']('[/tintuc]'));
    muangay = _0x451dx2['innerHTML']['substring'](_0x451dx2['innerHTML']['indexOf']('[muangay]') + 9, _0x451dx2['innerHTML']['indexOf']('[/muangay]'));
    kythuat = -1 != _0x451dx2['innerHTML']['indexOf']('[kythuat]') ? _0x451dx2['innerHTML']['substring'](_0x451dx2['innerHTML']['indexOf']('[kythuat]') + 9, _0x451dx2['innerHTML']['indexOf']('[/kythuat]')) : '<b>Th\xF4ng s\u1ED1 k\u1EF9 thu\u1EADt ch\u01B0a \u0111\u01B0\u1EE3c c\u1EADp nh\u1EADt</b>';
    mota = -1 != _0x451dx2['innerHTML']['indexOf']('[mota]') ? _0x451dx2['innerHTML']['substring'](_0x451dx2['innerHTML']['indexOf']('[mota]') + 6, _0x451dx2['innerHTML']['indexOf']('[/mota]')) : '<b>Kh\xF4ng c\xF3 m\xF4 t\u1EA3 cho s\u1EA3n ph\u1EA9m n\xE0y</b>';
    hinhanh = -1 != _0x451dx2['innerHTML']['indexOf']('[mota]') ? _0x451dx2['innerHTML']['substring'](_0x451dx2['innerHTML']['indexOf']('[hinhanh]') + 9, _0x451dx2['innerHTML']['indexOf']('[/hinhanh]')) : '<b>Kh\xF4ng c\xF3 h\xECnh \u1EA3nh cho s\u1EA3n ph\u1EA9m n\xE0y</b>';
  _0x451dx2['innerHTML'] = -1 != _0x451dx2['innerHTML']['indexOf']('[tintuc]') ? '<div class="tintuc"><h2 class="newstitle"><a href="' + _0x451dx4 + '">' + _0x451dx3 + '</a></h2><p>' + tintuc + '</p></div>' : '<div id="chitietspmoi" class="productinfo simpleCart_shelfItem"><div class="lproduct"><a href="' + _0x451dx7[0]['src'] + '">' + _0x451dx5 + ' </a><div class="addthis_toolbox addthis_default_style "><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a></div></div><div class="rproduct"><fieldset><h5 class="item_name">' + _0x451dx3 + '</h5>' + _0x451dx9 + '<a title ="Click \u0111\u1EB7t h\xE0ng" target="_blank" class="dathang" href="/p/dat-hang.html">\u0110\u1EB7t h\xE0ng</a></fieldset></div></div><div class="clear"></div><div class="chitiet domtab"><fieldset><legend><ul class="domtabs"><li><a href="#t1">' + tabtitle1 + '</a></li></ul></legend><div class="tab_content_1" style="font-size: 11pt;text-align: justify;"><a id="t1" name="t1"></a>' + kythuat + '</div></fieldset></div><span style="display:none;" class="price item_price">' + _0x451dxa + '</span><span class="item_thumb">' + _0x451dx7[0]['src'] + '</span></div>';
};
function relatedproduct(_0x451dx2) {
    j = showRandomImg ? Math['floor']((imgr['length'] + 1) * Math['random']()) : 0;
    img = [];
    for (var _0x451dx3 = 0; _0x451dx3 < _0x451dx2['feed']['entry']['length']; _0x451dx3++) {
        var _0x451dx4 = _0x451dx2['feed']['entry'][_0x451dx3]['content']['$t'];
    };
    retitle = -1 != _0x451dx4['indexOf']('[tintucmoi]') ? renewstitle : relatedtitle;
    document['write']('<div class="relatedproducts"><fieldset><legend>' + retitle + '</legend>');
    for (_0x451dx4 = 0; _0x451dx4 < relatednumposts; _0x451dx4++) {
        var _0x451dx5 = _0x451dx2['feed']['entry'][_0x451dx4],
            _0x451dx7 = _0x451dx5['title']['$t'],
            _0x451dx9;
        if (_0x451dx4 == _0x451dx2['feed']['entry']['length']) {
            break;
        };
        for (var _0x451dxa = 0; _0x451dxa < _0x451dx5['link']['length']; _0x451dxa++) {
            if ('alternate' == _0x451dx5['link'][_0x451dxa]['rel']) {
                _0x451dx9 = _0x451dx5['link'][_0x451dxa]['href'];
                break;
            };
        };
        for (_0x451dxa = 0; _0x451dxa < _0x451dx5['link']['length']; _0x451dxa++) {
            if ('replies' == _0x451dx5['link'][_0x451dxa]['rel'] && 'text/html' == _0x451dx5['link'][_0x451dxa]['type']) {
                _0x451dx5['link'][_0x451dxa]['title']['split'](' ');
                break;
            };
        };
var giaban = _0x451dx9['substring'](_0x451dx9['indexOf']('[giaban]') + 8, _0x451dx9['indexOf']('[/giaban]'));
        var _0x451dx3 = 'content' in _0x451dx5 ? _0x451dx5['content']['$t'] : 'summary' in _0x451dx5 ? _0x451dx5['summary']['$t'] : '',
            _0x451dxc = _0x451dx3['substring'](_0x451dx3['indexOf']('[price]') + 7, _0x451dx3['indexOf']('[/price]'));
        postdate = _0x451dx5['published']['$t'];
        j > imgr['length'] - 1 && (j = 0);
        img[_0x451dx4] = imgr[j];
        s = _0x451dx3;
        a = s['indexOf']('<img');
        b = s['indexOf']('src="', a);
        c = s['indexOf']('"', b + 5);
        d = s['substr'](b + 5, c - b - 5); - 1 != a && -1 != b && -1 != c && '' != d && (img[_0x451dx4] = d);
        _0x451dx5 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
        postdate['split']('-')[2]['substring'](0, 2);
        _0x451dxa = postdate['split']('-')[1];
        postdate['split']('-');
        for (var _0x451dxc = _0x451dx3['substring'](_0x451dx3['indexOf']('[giaban]') + 8, _0x451dx3['indexOf']('[/giaban]')), _0x451dxd = 0; _0x451dxd < _0x451dx5['length'] && parseInt(_0x451dxa) != _0x451dx5[_0x451dxd]; _0x451dxd++) {;;
        }; - 1 != _0x451dx3['indexOf']('[tintucmoi]') ? document['write']('<ul class="relatednews"><li><a href="' + _0x451dx9 + '">' + _0x451dx7 + '</a></li></ul>') : document['write']('<div class="relatedcont"><a href="' + _0x451dx9 + '"><img title="' + _0x451dx7 + '" alt="' + _0x451dx7 + '" src="' + img[_0x451dx4] + '"/></a><h3><a href="' + _0x451dx9 + '">' + _0x451dx7 + '</a></h3></div>');
        j++;
    };
    document['write']('</fieldset></div>');
};

function labelproduct(_0x451dx2) {
    j = showRandomImg ? Math['floor']((imgr['length'] + 1) * Math['random']()) : 0;
    img = [];
    for (var _0x451dx3 = 0; _0x451dx3 < labelnumposts; _0x451dx3++) {
        var _0x451dx4 = _0x451dx2['feed']['entry'][_0x451dx3],
            _0x451dx5 = _0x451dx4['title']['$t'],
            _0x451dx7;
        if (_0x451dx3 == _0x451dx2['feed']['entry']['length']) {
            break;
        };
        for (var _0x451dx9 = 0; _0x451dx9 < _0x451dx4['link']['length']; _0x451dx9++) {
            if ('alternate' == _0x451dx4['link'][_0x451dx9]['rel']) {
                _0x451dx7 = _0x451dx4['link'][_0x451dx9]['href'];
                break;
            };
        };
        for (_0x451dx9 = 0; _0x451dx9 < _0x451dx4['link']['length']; _0x451dx9++) {
            if ('replies' == _0x451dx4['link'][_0x451dx9]['rel'] && 'text/html' == _0x451dx4['link'][_0x451dx9]['type']) {
                _0x451dx4['link'][_0x451dx9]['title']['split'](' ');
                break;
            };
        };
        _0x451dx9 = 'content' in _0x451dx4 ? _0x451dx4['content']['$t'] : 'summary' in _0x451dx4 ? _0x451dx4['summary']['$t'] : '';
        giaban = _0x451dx9['substring'](_0x451dx9['indexOf']('[giaban]') + 8, _0x451dx9['indexOf']('[/giaban]'));
        kythuat = -1 != _0x451dx9['indexOf']('[kythuat]') ? _0x451dx9['substring'](_0x451dx9['indexOf']('[kythuat]') + 9, _0x451dx9['indexOf']('[/kythuat]')) : '<b>Kh\xF4ng c\xF3 m\xF4 t\u1EA3 cho s\u1EA3n ph\u1EA9m n\xE0y</b>';
        postdate = _0x451dx4['published']['$t'];
        j > imgr['length'] - 1 && (j = 0);
        img[_0x451dx3] = imgr[j];
        s = _0x451dx9;
        a = s['indexOf']('<img');
        b = s['indexOf']('src="', a);
        c = s['indexOf']('"', b + 5);
        d = s['substr'](b + 5, c - b - 5); - 1 != a && -1 != b && -1 != c && '' != d && (img[_0x451dx3] = d);
        _0x451dx4 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
        postdate['split']('-')[2]['substring'](0, 2);
        _0x451dx9 = postdate['split']('-')[1];
        postdate['split']('-');
        for (var _0x451dxa = 0; _0x451dxa < _0x451dx4['length'] && parseInt(_0x451dx9) != _0x451dx4[_0x451dxa]; _0x451dxa++) {;;
        };
        _0x451dx5 = ' <div class="labelproduct simpleCart_shelfItem"><div class="description"><a href="' + _0x451dx7 + '"><img class="product" src="' + img[_0x451dx3] + '" /></a></div><a href="' + _0x451dx7 + '"><h5 class="item_name">' + removeHtmlTag(_0x451dx5, labelsumtitle) + '</h5></a> <div class="item_price1"><span class="item_price">' + giaban + '</span></div><div class="bottom"><a class="dt" href="' + _0x451dx7 + '">Chi ti\u1EBFt</a></div><span class="item_thumb">' + img[_0x451dx3] + '</span><div class="b_btm"></div><div class="clear"></div></div> ';
        document['write'](_0x451dx5);
        j++;
    };
};
function showrecentposts(_0x451dx2) {
 j = showRandomImg ? Math['floor']((imgr['length'] + 1) * Math['random']()) : 0;
    img = [];
document.write('<ul>');
    for (var _0x451dx3 = 0; _0x451dx3 < numposts1; _0x451dx3++) {
        var _0x451dx4 = _0x451dx2['feed']['entry'][_0x451dx3],
            _0x451dx5 = _0x451dx4['title']['$t'],
            _0x451dx7;
        if (_0x451dx3 == _0x451dx2['feed']['entry']['length']) {
            break;
        };
        for (var _0x451dx9 = 0; _0x451dx9 < _0x451dx4['link']['length']; _0x451dx9++) {
            if ('alternate' == _0x451dx4['link'][_0x451dx9]['rel']) {
                _0x451dx7 = _0x451dx4['link'][_0x451dx9]['href'];
                break;
            };
        };
        for (_0x451dx9 = 0; _0x451dx9 < _0x451dx4['link']['length']; _0x451dx9++) {
            if ('replies' == _0x451dx4['link'][_0x451dx9]['rel'] && 'text/html' == _0x451dx4['link'][_0x451dx9]['type']) {
                _0x451dx4['link'][_0x451dx9]['title']['split'](' ');
                break;
            };
        };
        _0x451dx9 = 'content' in _0x451dx4 ? _0x451dx4['content']['$t'] : 'summary' in _0x451dx4 ? _0x451dx4['summary']['$t'] : '';
        giaban = _0x451dx9['substring'](_0x451dx9['indexOf']('[giaban]') + 8, _0x451dx9['indexOf']('[/giaban]'));
        kythuat = -1 != _0x451dx9['indexOf']('[kythuat]') ? _0x451dx9['substring'](_0x451dx9['indexOf']('[kythuat]') + 9, _0x451dx9['indexOf']('[/kythuat]')) : '<b>Kh\xF4ng c\xF3 m\xF4 t\u1EA3 cho s\u1EA3n ph\u1EA9m n\xE0y</b>';
        postdate = _0x451dx4['published']['$t'];
        j > imgr['length'] - 1 && (j = 0);
        img[_0x451dx3] = imgr[j];
        s = _0x451dx9;
        a = s['indexOf']('<img');
        b = s['indexOf']('src="', a);
        c = s['indexOf']('"', b + 5);
        d = s['substr'](b + 5, c - b - 5); - 1 != a && -1 != b && -1 != c && '' != d && (img[_0x451dx3] = d);
        _0x451dx4 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
        postdate['split']('-')[2]['substring'](0, 2);
        _0x451dx9 = postdate['split']('-')[1];
        postdate['split']('-');
        for (var _0x451dxa = 0; _0x451dxa < _0x451dx4['length'] && parseInt(_0x451dx9) != _0x451dx4[_0x451dxa]; _0x451dxa++) {;;
        };
      _0x451dx5 ='<li class="car"><div class="thumb"><a href="'+_0x451dx7+'"><img style="width:150px;height:150px;margin: 21px; class="alignnone" src="'+img[_0x451dx3]+'"/></a></div><div class="thongtin"><a href="' + _0x451dx7 + '"><h5 class="item_name">' + removeHtmlTag(_0x451dx5, labelsumtitle) + '</h5></a> <div class="item_price2"><span class="item_price">' + giaban + '</span></div></div></li>';
        document['write'](_0x451dx5);
        j++;
    };
document.write('</ul>');
}
function helloximo02(json) {
	j = (showRandomImg) ? Math.floor((imgr.length+1)*Math.random()) : 0; img  = new Array();
    if (numposts <= json.feed.entry.length) {maxpost = numposts;} else {maxpost=json.feed.entry.length;}		
    for (var i = 0; i < maxpost; i++) {var entry = json.feed.entry[i]; var posttitle = entry.title.$t; var pcm; var posturl;
    if (i == json.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {if (entry.link[k].rel == 'alternate') {posturl = entry.link[k].href; break;}}		
	for (var k = 0; k < entry.link.length; k++) {if (entry.link[k].rel == 'replies' && entry.link[k].type == 'text/html') {pcm = entry.link[k].title.split(" ")[0]; break;}}		
    if ("content" in entry) {var postcontent = entry.content.$t;} else if ("summary" in entry) {var postcontent = entry.summary.$t;} else var postcontent = ""; 	
	if(j>imgr.length-1) j=0; img[i] = imgr[j];	
	s = postcontent	; a = s.indexOf("<img"); b = s.indexOf("src=\"",a); c = s.indexOf("\"",b+5); d = s.substr(b+5,c-b-5);
	if((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")) img[i] = d;
if(i>=0 && i <=10){var trtd = '<div class="hello-h-left"><a href="'+posturl+'" title="'+posttitle+'"><img src="'+img[i]+'"/></a><h3><a href="'+posturl+'" title="'+posttitle+'">'+posttitle+'</a></h3><div class="hello-left-info">'+removeHtmlTag(postcontent['substring'](postcontent['indexOf']('[tintuc]') + 8, postcontent['indexOf']('[/tintuc]')),200)+'...</div></div>'; document.write(trtd); }			  
}
document.write('');
}